gl renderer: Ensure texture sizes arent 0
authorTimm Bäder <mail@baedert.org>
Sat, 9 Dec 2017 13:31:10 +0000 (14:31 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 21 Dec 2017 18:12:32 +0000 (19:12 +0100)
We already ceil() the given float texture sizes here, so if they are
valid, the result should definitely be > 0. Textures with size 0 can't
be properly used, especially not as render targets, where they will
trigger an assertion failure later in a glCheckFramebuffer call.

gsk/gl/gskgldriver.c

index 9b49ebed0c225e4def1a238955194ced28ce3535..999b3af2cf0018599510b8f22b692f3ea7a1dc10 100644 (file)
@@ -429,6 +429,9 @@ create_texture (GskGLDriver *self,
   int width = ceilf (fwidth);
   int height = ceilf (fheight);
 
+  g_assert (width > 0);
+  g_assert (height > 0);
+
   if (width >= self->max_texture_size ||
       height >= self->max_texture_size)
     {